iterate (OTF Keyword)
Iterates an internal object list generating all code within the iterator's loop block.
Syntax
%iterate Object.GetList as iterator-name%
[code text].
%end%
Remarks
Use the iterate statement to loop through an ObjGen internal object list and generate a body of code text for each item found in the list.
The iterator body should always be terminated with an %end% keyword.
The defined iterator supports the following calls
GetCount - returns the number of items contained in the list
being iterated
GetIndex - returns the current 0 based index of the iterators
current position
GetPosition - returns a 1 based positional value representing the
current item being iterated
GetObject - returns a callable reference to the object that is
currently being iterated.
Modifiers
(object.GetList) Specifies the source list that will be used to iterate. See the ObjGen OTF call reference for exposed object lists.
(iter-name) Specifies the unique name that will be assigned to the iterator object for calling purposes. This name should be unique within a single ObjGen OTF template.
Example
This example iterates a class object's internal property list and creates a private property in the generated code for each item found in the list.
%iterate CLASS.GetPropertyList as propIter%
Private m_%propIter.GetObject.GetName% As String
%end%